package com.compass.doctor.ui.mine

import android.content.Context
import android.content.Intent
import android.os.Bundle
import com.compass.doctor.databinding.ActivityIncomeDetailsBinding
import com.compass.doctor.base.BaseVBActivity
import com.compass.framework.constant.KEY_INCOME_DETAILS
import com.compass.framework.manager.DictionariesManager
import com.compass.framework.model.WalletDetail
import com.compass.framework.utils.DateUtils

/**
 * Description： 收入详情
 * Date:2023/12/26 16:14
 */
class IncomeDetailsActivity : BaseVBActivity<ActivityIncomeDetailsBinding>() {
    companion object {
        fun start(context: Context, wallet: WalletDetail?) {
            val intent = Intent(context, IncomeDetailsActivity::class.java)
            intent.putExtra(KEY_INCOME_DETAILS, wallet)
            context.startActivity(intent)
        }
    }

    private  var wallet: WalletDetail?=null


    override fun initView(savedInstanceState: Bundle?) {
        wallet = intent.serializable(KEY_INCOME_DETAILS)
        wallet?.let {
            mBinding.apply {
                tvRelevance.text=it.title
                tvChangePrice.text=it.changePrice.toString()
                tvTimePayment.text=DateUtils.conversionTime(it.createTime,DateUtils.FORMAT_ONE)
                tvSourcePayment.text=DictionariesManager.getWalletLogSourceSource(it.source.toString())
                tvPayerName.text=it.payerName
            }

        }


    }


}